import React, { Component } from 'react'
import Find from "./pages/Find"
import User from "./pages/User"
import Tabbar from "./components/Tabbar"
import './App.css'

export default class App extends Component {
  state = {
    FindStyle: {
      display: 'block'
    },
    UserStyle: {
      display: 'none'
    }
  }
  render () {
    return (
      <div>
        <header>

        </header>
        <main>
          <div style={this.state.FindStyle}>
            <Find />
          </div>
          <div style={this.state.UserStyle}>
            <User />
          </div>
        </main>
        <footer>
          <Tabbar parent={this} />
        </footer>
      </div>
    )
  }
  getTabbar = (title) => {
    title === "首页" ? this.setState({ FindStyle: { display: 'block' } }) : this.setState({ FindStyle: { display: 'none' } })
    title === "我的" ? this.setState({ UserStyle: { display: 'block' } }) : this.setState({ UserStyle: { display: 'none' } })
  }
}